<?php defined('INDEX_FILE') or die('error001');


/**
* MLT Web Engine
* http://www.molot-soft.ru
*
* @package MLT_WE
* @subpackage Simple_TPL
* @author Ivan Chistyakov <ivan@molot-soft.ru>
* @version $Id: date.stpl.php 28 2008-01-17 09:40:21Z molotsoft@gmail.com $
* @link $HeadURL: http://simple-tpl.googlecode.com/svn/trunk/tags/date.stpl.php $
*/


define('STPL_DATE_DEF_FORMAT', 'd.m.Y');


class stpl_date_element extends simple_tpl_element {

	public function get_data() {
		$format = $this->get_attribute('format', STPL_DATE_DEF_FORMAT);
		if (key_match($format)) {
			$constant_name = strtoupper('date_' . $format);
			if (defined($constant_name)) $format = constant($constant_name);
		}
		return date(hsc($format), (int)$this->get_value());
	}

}


?>